<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h1>Search for posts</h1>
    <form method="get">
        {{ form.as_p }}
        <input class="btn btn-primary my-1" type="submit" value="search">
        </input>
    </form>

    {% for post in results %}
    <div class="post-preview">
        {{ post.title }}
    </div>
    {% endfor %}
</body>

</html>